// RUN_PIPELINE_TILL: FRONTEND
// DIAGNOSTICS: -UNUSED_VARIABLE
// Issue: KT-35075

fun foo() {}

fun main() {
    val x1 = <!UNRESOLVED_REFERENCE!>logger<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x2 = <!UNRESOLVED_REFERENCE!>logger<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x3 = <!UNRESOLVED_REFERENCE!>logger<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x4 = <!UNRESOLVED_REFERENCE!>logger<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x5 = <!UNRESOLVED_REFERENCE!>logger<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x6 = <!UNRESOLVED_REFERENCE!>logger<!>!!::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x7 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE!>logger<!>::<!UNRESOLVED_REFERENCE!>info<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x8 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>logger<!>?::<!UNRESOLVED_REFERENCE!>info<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x9 = <!UNRESOLVED_REFERENCE!>logger<!>!!::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x10 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE!>logger<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!UNRESOLVED_REFERENCE!>print<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x11 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE!>logger<!>!!::<!UNRESOLVED_REFERENCE!>info<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!UNRESOLVED_REFERENCE!>print<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x12 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>logger<!>?::<!UNRESOLVED_REFERENCE!>info<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!UNRESOLVED_REFERENCE!>print<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x13 = <!RESERVED_SYNTAX_IN_CALLABLE_REFERENCE_LHS!>42<!>?::<!UNRESOLVED_REFERENCE!>unresolved<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>

    val x14 = <!UNRESOLVED_REFERENCE!>logger<!><!SYNTAX!>?!!::info?::print?::print<!>
    val x15 = <!UNRESOLVED_REFERENCE!>logger<!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!><!SYNTAX!>?!!::print?::print<!>
    val x16 = <!UNRESOLVED_REFERENCE!>logger<!>!!?::<!DEBUG_INFO_MISSING_UNRESOLVED!>info<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>
    val x17 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!UNRESOLVED_REFERENCE!>logger<!>::<!UNRESOLVED_REFERENCE!>info<!><!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>?::<!DEBUG_INFO_MISSING_UNRESOLVED!>print<!>

    // It must be OK
    val x18 = String?::hashCode <!USELESS_ELVIS!>?: ::foo<!>
    val x19 = String::hashCode <!USELESS_ELVIS!>?: ::foo<!>
    val x20 = <!INCORRECT_CALLABLE_REFERENCE_RESOLUTION_FOR_COMPANION_LHS!>String?::hashCode<!>::hashCode
    val x21 = <!INCORRECT_CALLABLE_REFERENCE_RESOLUTION_FOR_COMPANION_LHS!>kotlin.String?::hashCode<!>::hashCode
}

/* GENERATED_FIR_TAGS: callableReference, checkNotNullCall, elvisExpression, functionDeclaration, integerLiteral,
localProperty, propertyDeclaration */
